<?php

namespace App\Jobs;
use App\Models\User;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;





class SendEmail implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $use;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct(User $user)
    {
        $this->use = $user;
    }
//
    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        //

        $use = $this->use;

        Mail::raw('这里填写邮件的内容',function ($message){
            // 发件人（你自己的邮箱和名称）
            $message->from('love_ping891122@163.com', 'dlp001');
            // 收件人的邮箱地址
//            $message->to($this->user->eamil);
            $message->to('519773606@qq.com');
            // 邮件主题
            $message->subject('队列发送邮件');
        });
    }
}
